Conversation
scripts/check-syscall-coverage.py parses src/syscall/dispatch.tbl and
scans tests/ for direct or aliased references to every entry. C
sources are matched on call-shape (name followed by an opening paren)
or the SYS_/__NR_ macro forms; non-C sources require the explicit
macro form so that coreutils applet invocations in the shell suites
(run sync 0, run kill ..., run chroot ...) cannot falsely cover the
like-named syscalls. ALIASES maps the pread64/pwrite64 dispatch names
to the pread/pwrite libc wrappers; INDIRECT_COVERAGE documents the
xattr family, rt_sig{return,suspend,pending}, ptrace, chroot,
truncate, exit_group, and get_robust_list, which are exercised only
through structural or out-of-band paths. mk/tests.mk runs the script
as a check-syscall-coverage target that make check depends on.
src/syscall/syscall.c::sc_memfd_create rejects a NULL name pointer
with EFAULT, probes the first byte of the guest pointer to surface
EFAULT before the temp file is created, and reads the flag bits
through named LINUX_MFD_CLOEXEC and LINUX_MFD_ALLOW_SEALING constants
in src/syscall/abi.h instead of the prior raw bitmask arithmetic.
Unknown MFD_* bits continue to be accepted silently to match the
behavior the existing fd-lifecycle tests expect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/check-syscall-coverage.py parses src/syscall/dispatch.tbl and scans tests/ for direct or aliased references to every entry. C sources are matched on call-shape (name followed by an opening paren) or the SYS_/_NR macro forms; non-C sources require the explicit macro form so that coreutils applet invocations in the shell suites (run sync 0, run kill ..., run chroot ...) cannot falsely cover the like-named syscalls. ALIASES maps the pread64/pwrite64 dispatch names to the pread/pwrite libc wrappers; INDIRECT_COVERAGE documents the xattr family, rt_sig{return,suspend,pending}, ptrace, chroot, truncate, exit_group, and get_robust_list, which are exercised only through structural or out-of-band paths. mk/tests.mk runs the script as a check-syscall-coverage target that make check depends on.
src/syscall/syscall.c::sc_memfd_create rejects a NULL name pointer with EFAULT, probes the first byte of the guest pointer to surface EFAULT before the temp file is created, and reads the flag bits through named LINUX_MFD_CLOEXEC and LINUX_MFD_ALLOW_SEALING constants in src/syscall/abi.h instead of the prior raw bitmask arithmetic. Unknown MFD_* bits continue to be accepted silently to match the behavior the existing fd-lifecycle tests expect.
Summary by cubic
Adds a syscall coverage audit and a direct-syscall smoke suite, and wires both into the test workflow. Also tightens memfd_create error handling and flags, and streamlines the coreutils tests.
New Features
scripts/check-syscall-coverage.pyauditssrc/syscall/dispatch.tblagainst tests and runs viamake check(check-syscall-coverage).tests/test-syscall-smoke.ccovers less-common syscalls (e.g., pwrite64/preadv2, splice/vmsplice, close_range, execveat, waitid, accept4, SysV semaphores) plus expected stub errnos.test-lowbase-mem-200000,-300000); Makefile builds non-PIE binaries to exercise old guard windows.tests/lib/coreutils-suite.shwith smoke/full profiles; unified static and dynamic runners; removedtests/test-coreutils-smoke.sh.coreutils_*asserts for file checks.memfd_createaccepts valid Linux flags (e.g.,MFD_HUGETLB).Bug Fixes
sc_memfd_createrejects NULL name with EFAULT, validates the first byte of the guest pointer before creating the temp file, and reads flags viaLINUX_MFD_CLOEXEC/LINUX_MFD_ALLOW_SEALING(unknown bits remain accepted to preserve existing test expectations).Written for commit 684654f. Summary will update on new commits.